import { formatMessage } from 'umi-plugin-locale';
import routes from './router'

const plugins = [
    // ref: https://umijs.org/plugin/umi-plugin-react.html
    ['umi-plugin-react', {
        antd: true,
        dva: {
            immer: true
        },
        dynamicImport: {
            loadingComponent: './components/PageLoading/index',
            webpackChunkName: true,
            level: 3,
        },
        title: '打算v',
        // title: {
        //     useLocale: true,
        //     defaultTitle: 'KD3300',
        //     format: '{parent}{separator}{current}'
        // },
        dll: true,
        locale: {
            enable: true,
            default: 'zh-CN',
            // default: 'en-US',
            baseNavigator: true,
        },
        routes: {
            exclude: [
                /models\//,
                /services\//,
                /model\.(t|j)sx?$/,
                /service\.(t|j)sx?$/,
                /components\//,
            ],
        },
    }],
]
// ref: https://umijs.org/config/
export default {
    hash: true,
    treeShaking: true,
    routes: routes,
    plugins: plugins,
    define: {
        'MAP_SOURCE': 'baidu',
        'VISUAL_API': VISUAL_API || 'http://127.0.0.1:81',
        'KD3000_URL': 'http://183.233.209.30:83/',
        'DES_KEY': '7e96c6045551061d3e1ee76c802d2b45',
        'KD3300_VERSION': '1.0'
    }
}
